package org.cspoker.ai.bots.bot.gametree.search.expander.sampling;

public class RelativeBetDistribution {

	/** 
	 * probs gives all probabilities for relative bets from 0 to 1
	 * with interval 0.001 (in other words, discrete)
	 */
	private final double[] probs = { 0.18529708, 7.6874E-06, 0.000215247,
			0.000376683, 0.002998086, 0.006495853, 0.012699584, 0.01661247,
			0.02471499, 0.031118594, 0.049483791, 0.059062291, 0.01797314,
			0.014337, 0.01247665, 0.012791833, 0.013706633, 0.010055119,
			0.010201179, 0.009524688, 0.010616299, 0.013814257, 0.009593875,
			0.008656012, 0.008502264, 0.008917384, 0.010039744, 0.010454863,
			0.00884051, 0.008371578, 0.008686762, 0.010454863, 0.010708548,
			0.006541977, 0.006403604, 0.00632673, 0.006026921, 0.005742487,
			0.005873173, 0.005719425, 0.005827049, 0.006511227, 0.006418979,
			0.006073046, 0.004712376, 0.004527878, 0.004412567, 0.004174258,
			0.004420255, 0.004089697, 0.004766188, 0.004358756, 0.005119808,
			0.007172344, 0.004058947, 0.003789888, 0.004527878, 0.00325177,
			0.003313269, 0.003105709, 0.003028835, 0.003213333, 0.002567591,
			0.002959649, 0.002998086, 0.002383094, 0.002844338, 0.002406156,
			0.002206284, 0.002490717, 0.001883413, 0.002175534, 0.002144784,
			0.002037161, 0.002175534, 0.002237033, 0.002221658, 0.002421531,
			0.001829601, 0.002206284, 0.001906475, 0.001622041, 0.002144784,
			0.001706603, 0.002006411, 0.001698915, 0.001960287, 0.001937225,
			0.001622041, 0.001706603, 0.001606667, 0.001737352, 0.00136067,
			0.001368357, 0.001499043, 0.001652791, 0.001729665, 0.001452919,
			0.00150673, 0.001260734, 0.001844976, 0.001014737, 0.001114673,
			0.001460606, 0.001137735, 0.001283796, 0.001091611, 0.001253046,
			0.001237671, 0.001429856, 0.001383732, 0.00115311, 0.001706603,
			0.00115311, 0.001022424, 0.001083923, 0.000968612, 0.001045486,
			0.001083923, 0.001137735, 0.001199234, 0.000983987, 0.001383732,
			0.001045486, 0.000884051, 0.001253046, 0.000545805, 0.001076236,
			0.000837927, 0.000753365, 0.000953238, 0.000630367, 0.000991675,
			0.000776427, 0.000930175, 0.000745678, 0.000676491, 0.00094555,
			0.000668804, 0.000960925, 0.000761053, 0.000830239, 0.000784115,
			0.001014737, 0.000553493, 0.000860989, 0.000576555, 0.000614992,
			0.000791802, 0.000707241, 0.000791802, 0.000676491, 0.000730303,
			0.000568868, 0.000653429, 0.000530431, 0.00056118, 0.00076874,
			0.000661116, 0.000630367, 0.000568868, 0.000430494, 0.000545805,
			0.000530431, 0.000638054, 0.000507368, 0.000553493, 0.000676491,
			0.000568868, 0.000515056, 0.000484306, 0.000553493, 0.000522743,
			0.000507368, 0.00041512, 0.000553493, 0.000438182, 0.000507368,
			0.000453557, 0.000507368, 0.000407432, 0.00041512, 0.000576555,
			0.000484306, 0.00041512, 0.000468931, 0.000422807, 0.000491994,
			0.000491994, 0.000515056, 0.000445869, 0.000399745, 0.000438182,
			0.00041512, 0.00041512, 0.000299809, 0.000315183, 0.000491994,
			0.000284434, 0.000392057, 0.000722616, 0.000153748, 0.000399745,
			0.000407432, 0.000184498, 0.000361308, 0.000315183, 0.000245997,
			0.000307496, 0.000322871, 0.000361308, 0.000299809, 0.000253684,
			0.000461244, 0.000253684, 0.000392057, 0.00035362, 0.000322871,
			0.00035362, 0.000392057, 0.000276746, 0.000307496, 0.000184498,
			0.000445869, 0.000315183, 0.000269059, 0.00035362, 0.000245997,
			0.000361308, 0.000253684, 0.000422807, 0.00041512, 0.000253684,
			0.000230622, 0.000153748, 0.000199872, 0.000330558, 0.00017681,
			0.000130686, 0.000292121, 0.000276746, 0.000292121, 0.000276746,
			0.000322871, 0.000299809, 0.000169123, 0.000245997, 0.000238309,
			0.000253684, 0.000238309, 0.000453557, 0.000115311, 0.000192185,
			0.000184498, 0.000269059, 0.000153748, 0.00020756, 0.000299809,
			0.00020756, 0.000253684, 0.000245997, 0.000284434, 0.000153748,
			0.000146061, 0.000276746, 0.000230622, 0.000222935, 0.000222935,
			0.000245997, 0.000230622, 0.000192185, 0.000307496, 0.000146061,
			0.000161435, 0.000161435, 0.000169123, 0.000161435, 0.000215247,
			0.000199872, 0.000169123, 0.000130686, 0.000184498, 0.000122998,
			0.000138373, 0.000161435, 0.000130686, 0.000345933, 0.000107624,
			0.000238309, 9.99362E-05, 0.00017681, 0.00017681, 0.000130686,
			0.000169123, 7.6874E-05, 0.000245997, 0.000115311, 0.000169123,
			0.000153748, 0.000146061, 0.000292121, 0.000107624, 0.000130686,
			9.99362E-05, 0.000215247, 0.000130686, 0.000107624, 0.000184498,
			0.000184498, 0.000184498, 9.99362E-05, 0.000161435, 0.000130686,
			0.000245997, 7.6874E-05, 0.000130686, 6.14992E-05, 6.91866E-05,
			0.000146061, 9.99362E-05, 0.000153748, 8.45614E-05, 9.22488E-05,
			0.000245997, 9.99362E-05, 0.000161435, 6.91866E-05, 0.000153748,
			0.000122998, 0.000122998, 8.45614E-05, 6.91866E-05, 9.22488E-05,
			0.000107624, 0.000361308, 9.99362E-05, 0.000115311, 8.45614E-05,
			0.000130686, 0.000169123, 0.000115311, 0.000107624, 9.22488E-05,
			9.22488E-05, 8.45614E-05, 0.000245997, 7.6874E-05, 9.99362E-05,
			9.22488E-05, 7.6874E-05, 0.000184498, 9.99362E-05, 8.45614E-05,
			0.000215247, 9.99362E-05, 0.000122998, 9.22488E-05, 5.38118E-05,
			0.000169123, 8.45614E-05, 0.000161435, 7.6874E-05, 9.99362E-05,
			0.000107624, 0.000107624, 7.6874E-05, 0.000115311, 0.000130686,
			8.45614E-05, 0.000115311, 0.000130686, 0.000199872, 5.38118E-05,
			7.6874E-05, 7.6874E-05, 0.000138373, 9.22488E-05, 7.6874E-05,
			6.91866E-05, 9.99362E-05, 0.000115311, 6.91866E-05, 5.38118E-05,
			6.91866E-05, 8.45614E-05, 0.00017681, 3.8437E-05, 6.91866E-05,
			4.61244E-05, 5.38118E-05, 7.6874E-05, 9.22488E-05, 7.6874E-05,
			6.91866E-05, 0.000115311, 0.000115311, 7.6874E-05, 8.45614E-05,
			7.6874E-05, 8.45614E-05, 0.000192185, 3.07496E-05, 9.22488E-05,
			5.38118E-05, 9.99362E-05, 8.45614E-05, 6.91866E-05, 6.14992E-05,
			8.45614E-05, 6.91866E-05, 3.8437E-05, 9.99362E-05, 8.45614E-05,
			6.14992E-05, 8.45614E-05, 4.61244E-05, 5.38118E-05, 0.000169123,
			4.61244E-05, 1.53748E-05, 6.14992E-05, 5.38118E-05, 8.45614E-05,
			5.38118E-05, 6.91866E-05, 7.6874E-05, 3.07496E-05, 6.91866E-05,
			4.61244E-05, 0.000107624, 3.8437E-05, 7.6874E-05, 0.000107624,
			0.000107624, 6.91866E-05, 0.000115311, 6.14992E-05, 9.22488E-05,
			7.6874E-05, 6.14992E-05, 6.14992E-05, 9.22488E-05, 6.91866E-05,
			3.07496E-05, 8.45614E-05, 7.6874E-05, 4.61244E-05, 6.14992E-05,
			5.38118E-05, 2.30622E-05, 6.91866E-05, 6.14992E-05, 6.91866E-05,
			3.07496E-05, 6.14992E-05, 0.000115311, 1.53748E-05, 4.61244E-05,
			1.53748E-05, 6.14992E-05, 2.30622E-05, 1.53748E-05, 6.91866E-05,
			4.61244E-05, 5.38118E-05, 4.61244E-05, 5.38118E-05, 6.14992E-05,
			3.07496E-05, 6.91866E-05, 6.14992E-05, 4.61244E-05, 3.8437E-05,
			3.07496E-05, 6.91866E-05, 9.22488E-05, 3.07496E-05, 9.22488E-05,
			1.53748E-05, 8.45614E-05, 8.45614E-05, 2.30622E-05, 3.8437E-05,
			4.61244E-05, 3.8437E-05, 2.30622E-05, 3.8437E-05, 7.6874E-05,
			3.8437E-05, 3.07496E-05, 3.07496E-05, 3.8437E-05, 3.8437E-05,
			3.07496E-05, 7.6874E-05, 3.07496E-05, 2.30622E-05, 3.8437E-05,
			3.07496E-05, 5.38118E-05, 9.99362E-05, 0, 6.14992E-05, 7.6874E-05,
			3.07496E-05, 4.61244E-05, 7.6874E-06, 4.61244E-05, 2.30622E-05,
			3.07496E-05, 4.61244E-05, 3.8437E-05, 5.38118E-05, 5.38118E-05,
			2.30622E-05, 4.61244E-05, 6.91866E-05, 3.8437E-05, 7.6874E-05,
			6.14992E-05, 6.91866E-05, 3.8437E-05, 5.38118E-05, 4.61244E-05,
			3.07496E-05, 3.07496E-05, 3.07496E-05, 6.14992E-05, 4.61244E-05,
			3.07496E-05, 6.91866E-05, 1.53748E-05, 3.07496E-05, 7.6874E-06,
			3.8437E-05, 3.07496E-05, 1.53748E-05, 7.6874E-06, 6.14992E-05,
			3.8437E-05, 5.38118E-05, 1.53748E-05, 1.53748E-05, 3.07496E-05,
			3.8437E-05, 2.30622E-05, 5.38118E-05, 4.61244E-05, 3.07496E-05,
			5.38118E-05, 5.38118E-05, 3.07496E-05, 3.07496E-05, 1.53748E-05,
			2.30622E-05, 0, 5.38118E-05, 3.07496E-05, 1.53748E-05, 2.30622E-05,
			7.6874E-05, 7.6874E-06, 3.07496E-05, 7.6874E-06, 4.61244E-05,
			1.53748E-05, 1.53748E-05, 3.8437E-05, 2.30622E-05, 2.30622E-05,
			3.07496E-05, 1.53748E-05, 6.14992E-05, 3.8437E-05, 4.61244E-05,
			6.14992E-05, 3.8437E-05, 3.07496E-05, 2.30622E-05, 7.6874E-06,
			1.53748E-05, 1.53748E-05, 3.07496E-05, 2.30622E-05, 2.30622E-05,
			3.8437E-05, 1.53748E-05, 7.6874E-06, 7.6874E-06, 5.38118E-05,
			7.6874E-06, 2.30622E-05, 1.53748E-05, 3.8437E-05, 5.38118E-05,
			7.6874E-06, 2.30622E-05, 0, 3.07496E-05, 0, 2.30622E-05, 0, 0,
			1.53748E-05, 2.30622E-05, 3.07496E-05, 0, 3.8437E-05, 1.53748E-05,
			3.07496E-05, 3.07496E-05, 3.07496E-05, 3.8437E-05, 2.30622E-05,
			7.6874E-06, 7.6874E-06, 3.07496E-05, 1.53748E-05, 7.6874E-06,
			3.07496E-05, 2.30622E-05, 2.30622E-05, 7.6874E-06, 0, 2.30622E-05,
			5.38118E-05, 0, 7.6874E-06, 1.53748E-05, 0, 3.8437E-05,
			1.53748E-05, 3.07496E-05, 1.53748E-05, 7.6874E-06, 3.8437E-05, 0,
			3.8437E-05, 7.6874E-06, 1.53748E-05, 3.8437E-05, 7.6874E-06,
			2.30622E-05, 1.53748E-05, 2.30622E-05, 7.6874E-06, 1.53748E-05,
			7.6874E-06, 1.53748E-05, 2.30622E-05, 7.6874E-06, 7.6874E-06,
			7.6874E-06, 2.30622E-05, 7.6874E-06, 1.53748E-05, 7.6874E-06,
			7.6874E-06, 1.53748E-05, 7.6874E-06, 1.53748E-05, 7.6874E-06,
			2.30622E-05, 7.6874E-06, 7.6874E-06, 7.6874E-06, 1.53748E-05,
			7.6874E-05, 1.53748E-05, 1.53748E-05, 7.6874E-06, 7.6874E-06,
			2.30622E-05, 7.6874E-06, 2.30622E-05, 1.53748E-05, 0, 7.6874E-06,
			7.6874E-06, 7.6874E-06, 3.07496E-05, 3.07496E-05, 3.07496E-05,
			2.30622E-05, 7.6874E-06, 2.30622E-05, 1.53748E-05, 7.6874E-06,
			1.53748E-05, 0, 1.53748E-05, 1.53748E-05, 0, 1.53748E-05,
			7.6874E-06, 1.53748E-05, 7.6874E-06, 1.53748E-05, 0, 7.6874E-06,
			7.6874E-06, 7.6874E-06, 7.6874E-06, 7.6874E-06, 7.6874E-06,
			7.6874E-06, 7.6874E-06, 7.6874E-06, 7.6874E-06, 7.6874E-06,
			7.6874E-06, 0, 0, 0, 0, 2.30622E-05, 1.53748E-05, 1.53748E-05,
			7.6874E-06, 7.6874E-06, 7.6874E-06, 7.6874E-06, 2.30622E-05, 0,
			2.30622E-05, 7.6874E-06, 7.6874E-06, 7.6874E-06, 7.6874E-06,
			7.6874E-06, 7.6874E-06, 7.6874E-06, 5.38118E-05, 0, 1.53748E-05,
			7.6874E-06, 7.6874E-06, 4.61244E-05, 7.6874E-06, 3.07496E-05,
			3.07496E-05, 3.07496E-05, 1.53748E-05, 7.6874E-06, 1.53748E-05, 0,
			1.53748E-05, 1.53748E-05, 1.53748E-05, 7.6874E-06, 1.53748E-05, 0,
			0, 7.6874E-06, 7.6874E-06, 7.6874E-06, 0, 7.6874E-06, 7.6874E-06,
			1.53748E-05, 7.6874E-06, 7.6874E-06, 7.6874E-06, 7.6874E-06,
			7.6874E-06, 7.6874E-06, 2.30622E-05, 3.07496E-05, 0, 1.53748E-05,
			3.8437E-05, 7.6874E-06, 0, 7.6874E-06, 3.07496E-05, 1.53748E-05,
			7.6874E-06, 1.53748E-05, 1.53748E-05, 7.6874E-06, 2.30622E-05,
			7.6874E-06, 1.53748E-05, 7.6874E-06, 7.6874E-06, 1.53748E-05, 0,
			7.6874E-06, 2.30622E-05, 2.30622E-05, 7.6874E-06, 7.6874E-06, 0, 0,
			7.6874E-06, 2.30622E-05, 2.30622E-05, 7.6874E-06, 0, 1.53748E-05,
			1.53748E-05, 7.6874E-06, 0, 1.53748E-05, 7.6874E-06, 7.6874E-06,
			7.6874E-06, 7.6874E-06, 0, 0, 1.53748E-05, 7.6874E-06, 0,
			7.6874E-06, 7.6874E-06, 7.6874E-06, 7.6874E-06, 0, 0, 1.53748E-05,
			0, 1.53748E-05, 2.30622E-05, 7.6874E-06, 1.53748E-05, 1.53748E-05,
			0, 0, 0, 0, 7.6874E-06, 7.6874E-06, 7.6874E-06, 0, 4.61244E-05, 0,
			7.6874E-06, 0, 1.53748E-05, 1.53748E-05, 0, 0, 7.6874E-06,
			7.6874E-06, 0, 1.53748E-05, 1.53748E-05, 2.30622E-05, 7.6874E-06,
			1.53748E-05, 7.6874E-06, 7.6874E-06, 0, 7.6874E-06, 0, 0,
			2.30622E-05, 1.53748E-05, 7.6874E-06, 0, 0, 0, 0, 0, 7.6874E-06,
			7.6874E-06, 0, 7.6874E-06, 7.6874E-06, 7.6874E-06, 0, 1.53748E-05,
			0, 0, 7.6874E-06, 2.30622E-05, 7.6874E-06, 0, 7.6874E-06,
			7.6874E-06, 7.6874E-06, 1.53748E-05, 7.6874E-06, 1.53748E-05, 0, 0,
			7.6874E-06, 1.53748E-05, 7.6874E-06, 1.53748E-05, 7.6874E-06,
			7.6874E-06, 0, 3.07496E-05, 0, 0, 1.53748E-05, 7.6874E-06, 0,
			1.53748E-05, 3.07496E-05, 0, 1.53748E-05, 0, 1.53748E-05, 0, 0, 0,
			0, 0, 3.8437E-05, 0, 0, 7.6874E-06, 1.53748E-05, 0, 7.6874E-06,
			7.6874E-06, 0, 2.30622E-05, 7.6874E-06, 7.6874E-06, 7.6874E-06,
			7.6874E-06, 3.07496E-05, 7.6874E-06, 2.30622E-05, 1.53748E-05,
			7.6874E-06, 0, 7.6874E-06, 1.53748E-05, 7.6874E-06, 0, 7.6874E-06,
			0, 0, 0, 1.53748E-05, 0, 0, 3.8437E-05, 0, 1.53748E-05, 0,
			3.07496E-05, 0, 0, 0, 7.6874E-06, 7.6874E-06, 7.6874E-06, 0,
			2.30622E-05, 1.53748E-05, 7.6874E-06, 0, 7.6874E-06, 2.30622E-05,
			2.30622E-05, 1.53748E-05, 1.53748E-05, 1.53748E-05, 7.6874E-06, 0,
			0, 1.53748E-05, 3.07496E-05, 7.6874E-06, 3.07496E-05, 7.6874E-06,
			0, 0, 1.53748E-05, 7.6874E-06, 2.30622E-05, 1.53748E-05,
			7.6874E-06, 7.6874E-06, 0, 0, 0, 0, 0, 0, 7.6874E-06, 7.6874E-06,
			7.6874E-06, 0, 0, 0, 1.53748E-05, 1.53748E-05, 1.53748E-05,
			1.53748E-05, 7.6874E-06, 0, 7.6874E-06, 0, 0, 0.03692258 };

	private final double[] cumProbs = { 0.18529708, 0.185304767, 0.185520014,
			0.185896697, 0.188894783, 0.195390635, 0.208090219, 0.22470269,
			0.249417679, 0.280536273, 0.330020064, 0.389082355, 0.407055495,
			0.421392496, 0.433869145, 0.446660978, 0.460367611, 0.47042273,
			0.480623909, 0.490148597, 0.500764896, 0.514579153, 0.524173028,
			0.53282904, 0.541331304, 0.550248687, 0.560288431, 0.570743295,
			0.579583804, 0.587955382, 0.596642144, 0.607097007, 0.617805555,
			0.624347532, 0.630751136, 0.637077866, 0.643104787, 0.648847274,
			0.654720448, 0.660439873, 0.666266922, 0.672778149, 0.679197128,
			0.685270174, 0.68998255, 0.694510428, 0.698922995, 0.703097253,
			0.707517508, 0.711607205, 0.716373392, 0.720732148, 0.725851956,
			0.7330243, 0.737083247, 0.740873135, 0.745401013, 0.748652783,
			0.751966052, 0.755071762, 0.758100597, 0.76131393, 0.763881522,
			0.766841171, 0.769839256, 0.77222235, 0.775066688, 0.777472844,
			0.779679128, 0.782169845, 0.784053258, 0.786228792, 0.788373577,
			0.790410738, 0.792586272, 0.794823305, 0.797044964, 0.799466494,
			0.801296096, 0.803502379, 0.805408854, 0.807030896, 0.80917568,
			0.810882283, 0.812888694, 0.814587609, 0.816547896, 0.818485121,
			0.820107162, 0.821813765, 0.823420432, 0.825157784, 0.826518454,
			0.827886811, 0.829385854, 0.831038645, 0.832768309, 0.834221228,
			0.835727958, 0.836988692, 0.838833668, 0.839848404, 0.840963077,
			0.842423683, 0.843561418, 0.844845214, 0.845936825, 0.847189871,
			0.848427542, 0.849857399, 0.851241131, 0.852394241, 0.854100843,
			0.855253953, 0.856276377, 0.857360301, 0.858328913, 0.859374399,
			0.860458323, 0.861596058, 0.862795292, 0.863779279, 0.865163011,
			0.866208498, 0.867092549, 0.868345595, 0.8688914, 0.869967636,
			0.870805563, 0.871558928, 0.872512165, 0.873142532, 0.874134207,
			0.874910634, 0.875840809, 0.876586487, 0.877262978, 0.878208528,
			0.878877332, 0.879838257, 0.88059931, 0.881429549, 0.882213664,
			0.8832284, 0.883781893, 0.884642882, 0.885219437, 0.885834429,
			0.886626231, 0.887333472, 0.888125274, 0.888801765, 0.889532068,
			0.890100936, 0.890754365, 0.891284795, 0.891845975, 0.892614715,
			0.893275832, 0.893906198, 0.894475066, 0.89490556, 0.895451366,
			0.895981796, 0.89661985, 0.897127219, 0.897680712, 0.898357203,
			0.89892607, 0.899441126, 0.899925432, 0.900478925, 0.901001668,
			0.901509037, 0.901924156, 0.902477649, 0.902915831, 0.903423199,
			0.903876756, 0.904384124, 0.904791556, 0.905206676, 0.905783231,
			0.906267537, 0.906682656, 0.907151588, 0.907574395, 0.908066388,
			0.908558382, 0.909073438, 0.909519307, 0.909919052, 0.910357233,
			0.910772353, 0.911187473, 0.911487281, 0.911802465, 0.912294458,
			0.912578892, 0.912970949, 0.913693565, 0.913847313, 0.914247058,
			0.91465449, 0.914838987, 0.915200295, 0.915515479, 0.915761475,
			0.916068971, 0.916391842, 0.91675315, 0.917052958, 0.917306643,
			0.917767887, 0.918021571, 0.918413628, 0.918767249, 0.919090119,
			0.91944374, 0.919835797, 0.920112544, 0.92042004, 0.920604537,
			0.921050406, 0.92136559, 0.921634649, 0.921988269, 0.922234266,
			0.922595574, 0.922849258, 0.923272065, 0.923687184, 0.923940869,
			0.924171491, 0.924325239, 0.924525111, 0.924855669, 0.925032479,
			0.925163165, 0.925455286, 0.925732033, 0.926024154, 0.9263009,
			0.926623771, 0.92692358, 0.927092702, 0.927338699, 0.927577009,
			0.927830693, 0.928069002, 0.928522559, 0.92863787, 0.928830055,
			0.929014552, 0.929283611, 0.929437359, 0.929644919, 0.929944728,
			0.930152287, 0.930405972, 0.930651968, 0.930936402, 0.93109015,
			0.931236211, 0.931512957, 0.931743579, 0.931966514, 0.932189448,
			0.932435445, 0.932666067, 0.932858252, 0.933165748, 0.933311809,
			0.933473244, 0.933634679, 0.933803802, 0.933965238, 0.934180485,
			0.934380357, 0.93454948, 0.934680166, 0.934864663, 0.934987662,
			0.935126035, 0.93528747, 0.935418156, 0.935764089, 0.935871713,
			0.936110022, 0.936209958, 0.936386768, 0.936563579, 0.936694264,
			0.936863387, 0.936940261, 0.937186258, 0.937301569, 0.937470692,
			0.93762444, 0.9377705, 0.938062622, 0.938170245, 0.938300931,
			0.938400867, 0.938616114, 0.9387468, 0.938854424, 0.939038921,
			0.939223419, 0.939407916, 0.939507853, 0.939669288, 0.939799974,
			0.940045971, 0.940122845, 0.94025353, 0.94031503, 0.940384216,
			0.940530277, 0.940630213, 0.940783961, 0.940868522, 0.940960771,
			0.941206768, 0.941306704, 0.94146814, 0.941537326, 0.941691074,
			0.941814073, 0.941937071, 0.942021632, 0.942090819, 0.942183068,
			0.942290691, 0.942651999, 0.942751935, 0.942867246, 0.942951808,
			0.943082493, 0.943251616, 0.943366927, 0.943474551, 0.9435668,
			0.943659048, 0.94374361, 0.943989607, 0.944066481, 0.944166417,
			0.944258666, 0.94433554, 0.944520037, 0.944619973, 0.944704535,
			0.944919782, 0.945019718, 0.945142717, 0.945234965, 0.945288777,
			0.9454579, 0.945542461, 0.945703897, 0.945780771, 0.945880707,
			0.945988331, 0.946095954, 0.946172828, 0.946288139, 0.946418825,
			0.946503386, 0.946618697, 0.946749383, 0.946949255, 0.947003067,
			0.947079941, 0.947156815, 0.947295188, 0.947387437, 0.947464311,
			0.947533498, 0.947633434, 0.947748745, 0.947817932, 0.947871743,
			0.94794093, 0.948025491, 0.948202302, 0.948240739, 0.948309925,
			0.94835605, 0.948409861, 0.948486735, 0.948578984, 0.948655858,
			0.948725045, 0.948840356, 0.948955667, 0.949032541, 0.949117102,
			0.949193976, 0.949278538, 0.949470723, 0.949501472, 0.949593721,
			0.949647533, 0.949747469, 0.94983203, 0.949901217, 0.949962716,
			0.950047278, 0.950116464, 0.950154901, 0.950254837, 0.950339399,
			0.950400898, 0.950485459, 0.950531584, 0.950585395, 0.950754518,
			0.950800643, 0.950816017, 0.950877517, 0.950931328, 0.95101589,
			0.951069702, 0.951138888, 0.951215762, 0.951246512, 0.951315698,
			0.951361823, 0.951469446, 0.951507883, 0.951584757, 0.951692381,
			0.951800005, 0.951869191, 0.951984502, 0.952046001, 0.95213825,
			0.952215124, 0.952276623, 0.952338123, 0.952430371, 0.952499558,
			0.952530308, 0.952614869, 0.952691743, 0.952737867, 0.952799367,
			0.952853178, 0.952876241, 0.952945427, 0.953006926, 0.953076113,
			0.953106863, 0.953168362, 0.953283673, 0.953299048, 0.953345172,
			0.953360547, 0.953422046, 0.953445108, 0.953460483, 0.95352967,
			0.953575794, 0.953629606, 0.95367573, 0.953729542, 0.953791041,
			0.953821791, 0.953890977, 0.953952476, 0.953998601, 0.954037038,
			0.954067787, 0.954136974, 0.954229223, 0.954259972, 0.954352221,
			0.954367596, 0.954452157, 0.954536719, 0.954559781, 0.954598218,
			0.954644342, 0.954682779, 0.954705842, 0.954744279, 0.954821153,
			0.95485959, 0.954890339, 0.954921089, 0.954959526, 0.954997963,
			0.955028712, 0.955105586, 0.955136336, 0.955159398, 0.955197835,
			0.955228585, 0.955282397, 0.955382333, 0.955382333, 0.955443832,
			0.955520706, 0.955551456, 0.95559758, 0.955605267, 0.955651392,
			0.955674454, 0.955705204, 0.955751328, 0.955789765, 0.955843577,
			0.955897389, 0.955920451, 0.955966575, 0.956035762, 0.956074199,
			0.956151073, 0.956212572, 0.956281759, 0.956320196, 0.956374007,
			0.956420132, 0.956450881, 0.956481631, 0.956512381, 0.95657388,
			0.956620004, 0.956650754, 0.95671994, 0.956735315, 0.956766065,
			0.956773752, 0.956812189, 0.956842939, 0.956858314, 0.956866001,
			0.9569275, 0.956965937, 0.957019749, 0.957035124, 0.957050499,
			0.957081248, 0.957119685, 0.957142747, 0.957196559, 0.957242684,
			0.957273433, 0.957327245, 0.957381057, 0.957411806, 0.957442556,
			0.957457931, 0.957480993, 0.957480993, 0.957534805, 0.957565554,
			0.957580929, 0.957603991, 0.957680865, 0.957688553, 0.957719302,
			0.95772699, 0.957773114, 0.957788489, 0.957803864, 0.957842301,
			0.957865363, 0.957888425, 0.957919175, 0.957934549, 0.957996049,
			0.958034486, 0.95808061, 0.958142109, 0.958180546, 0.958211296,
			0.958234358, 0.958242045, 0.95825742, 0.958272795, 0.958303545,
			0.958326607, 0.958349669, 0.958388106, 0.958403481, 0.958411168,
			0.958418856, 0.958472667, 0.958480355, 0.958503417, 0.958518792,
			0.958557229, 0.958611041, 0.958618728, 0.95864179, 0.95864179,
			0.95867254, 0.95867254, 0.958695602, 0.958695602, 0.958695602,
			0.958710977, 0.958734039, 0.958764789, 0.958764789, 0.958803226,
			0.9588186, 0.95884935, 0.9588801, 0.958910849, 0.958949286,
			0.958972348, 0.958980036, 0.958987723, 0.959018473, 0.959033848,
			0.959041535, 0.959072285, 0.959095347, 0.959118409, 0.959126096,
			0.959126096, 0.959149159, 0.95920297, 0.95920297, 0.959210658,
			0.959226033, 0.959226033, 0.95926447, 0.959279844, 0.959310594,
			0.959325969, 0.959333656, 0.959372093, 0.959372093, 0.95941053,
			0.959418218, 0.959433592, 0.959472029, 0.959479717, 0.959502779,
			0.959518154, 0.959541216, 0.959548903, 0.959564278, 0.959571966,
			0.95958734, 0.959610403, 0.95961809, 0.959625777, 0.959633465,
			0.959656527, 0.959664214, 0.959679589, 0.959687277, 0.959694964,
			0.959710339, 0.959718026, 0.959733401, 0.959741088, 0.959764151,
			0.959771838, 0.959779525, 0.959787213, 0.959802588, 0.959879462,
			0.959894836, 0.959910211, 0.959917899, 0.959925586, 0.959948648,
			0.959956336, 0.959979398, 0.959994773, 0.959994773, 0.96000246,
			0.960010147, 0.960017835, 0.960048584, 0.960079334, 0.960110084,
			0.960133146, 0.960140833, 0.960163895, 0.96017927, 0.960186958,
			0.960202332, 0.960202332, 0.960217707, 0.960233082, 0.960233082,
			0.960248457, 0.960256144, 0.960271519, 0.960279206, 0.960294581,
			0.960294581, 0.960302269, 0.960309956, 0.960317643, 0.960325331,
			0.960333018, 0.960340706, 0.960348393, 0.96035608, 0.960363768,
			0.960371455, 0.960379143, 0.96038683, 0.96038683, 0.96038683,
			0.96038683, 0.96038683, 0.960409892, 0.960425267, 0.960440642,
			0.960448329, 0.960456017, 0.960463704, 0.960471391, 0.960494454,
			0.960494454, 0.960517516, 0.960525203, 0.960532891, 0.960540578,
			0.960548265, 0.960555953, 0.96056364, 0.960571328, 0.960625139,
			0.960625139, 0.960640514, 0.960648202, 0.960655889, 0.960702013,
			0.960709701, 0.96074045, 0.9607712, 0.96080195, 0.960817324,
			0.960825012, 0.960840387, 0.960840387, 0.960855761, 0.960871136,
			0.960886511, 0.960894198, 0.960909573, 0.960909573, 0.960909573,
			0.960917261, 0.960924948, 0.960932635, 0.960932635, 0.960940323,
			0.96094801, 0.960963385, 0.960971072, 0.96097876, 0.960986447,
			0.960994135, 0.961001822, 0.961009509, 0.961032572, 0.961063321,
			0.961063321, 0.961078696, 0.961117133, 0.96112482, 0.96112482,
			0.961132508, 0.961163257, 0.961178632, 0.96118632, 0.961201694,
			0.961217069, 0.961224757, 0.961247819, 0.961255506, 0.961270881,
			0.961278568, 0.961286256, 0.96130163, 0.96130163, 0.961309318,
			0.96133238, 0.961355442, 0.96136313, 0.961370817, 0.961370817,
			0.961370817, 0.961378504, 0.961401567, 0.961424629, 0.961432316,
			0.961432316, 0.961447691, 0.961463066, 0.961470753, 0.961470753,
			0.961486128, 0.961493815, 0.961501503, 0.96150919, 0.961516878,
			0.961516878, 0.961516878, 0.961532252, 0.96153994, 0.96153994,
			0.961547627, 0.961555315, 0.961563002, 0.961570689, 0.961570689,
			0.961570689, 0.961586064, 0.961586064, 0.961601439, 0.961624501,
			0.961632189, 0.961647563, 0.961662938, 0.961662938, 0.961662938,
			0.961662938, 0.961662938, 0.961670626, 0.961678313, 0.961686,
			0.961686, 0.961732125, 0.961732125, 0.961739812, 0.961739812,
			0.961755187, 0.961770562, 0.961770562, 0.961770562, 0.961778249,
			0.961785937, 0.961785937, 0.961801311, 0.961816686, 0.961839748,
			0.961847436, 0.961862811, 0.961870498, 0.961878185, 0.961878185,
			0.961885873, 0.961885873, 0.961885873, 0.961908935, 0.96192431,
			0.961931997, 0.961931997, 0.961931997, 0.961931997, 0.961931997,
			0.961931997, 0.961939685, 0.961947372, 0.961947372, 0.961955059,
			0.961962747, 0.961970434, 0.961970434, 0.961985809, 0.961985809,
			0.961985809, 0.961993496, 0.962016559, 0.962024246, 0.962024246,
			0.962031933, 0.962039621, 0.962047308, 0.962062683, 0.96207037,
			0.962085745, 0.962085745, 0.962085745, 0.962093433, 0.962108807,
			0.962116495, 0.96213187, 0.962139557, 0.962147244, 0.962147244,
			0.962177994, 0.962177994, 0.962177994, 0.962193369, 0.962201056,
			0.962201056, 0.962216431, 0.962247181, 0.962247181, 0.962262555,
			0.962262555, 0.96227793, 0.96227793, 0.96227793, 0.96227793,
			0.96227793, 0.96227793, 0.962316367, 0.962316367, 0.962316367,
			0.962324055, 0.962339429, 0.962339429, 0.962347117, 0.962354804,
			0.962354804, 0.962377866, 0.962385554, 0.962393241, 0.962400929,
			0.962408616, 0.962439366, 0.962447053, 0.962470115, 0.96248549,
			0.962493177, 0.962493177, 0.962500865, 0.96251624, 0.962523927,
			0.962523927, 0.962531614, 0.962531614, 0.962531614, 0.962531614,
			0.962546989, 0.962546989, 0.962546989, 0.962585426, 0.962585426,
			0.962600801, 0.962600801, 0.962631551, 0.962631551, 0.962631551,
			0.962631551, 0.962639238, 0.962646925, 0.962654613, 0.962654613,
			0.962677675, 0.96269305, 0.962700737, 0.962700737, 0.962708425,
			0.962731487, 0.962754549, 0.962769924, 0.962785299, 0.962800673,
			0.962808361, 0.962808361, 0.962808361, 0.962823736, 0.962854485,
			0.962862173, 0.962892922, 0.96290061, 0.96290061, 0.96290061,
			0.962915984, 0.962923672, 0.962946734, 0.962962109, 0.962969796,
			0.962977484, 0.962977484, 0.962977484, 0.962977484, 0.962977484,
			0.962977484, 0.962977484, 0.962985171, 0.962992858, 0.963000546,
			0.963000546, 0.963000546, 0.963000546, 0.963015921, 0.963031295,
			0.96304667, 0.963062045, 0.963069732, 0.963069732, 0.96307742,
			0.96307742, 0.96307742, 1 };

	public int length() {
		return probs.length;
	}
	
	public double pdf(double x) {
		if (x < 0 || x > 1)
			return 0;
		int index = (int) (x * 1000);
		return probs[index];
	}
	
	public double cdf(double x) {
		if (x < 0 || x > 1)
			return 0;
		int index = (int) (x * 1000);
		return cumProbs[index];
	}
	
	public double inverseCdf(double x) {
		if (x < 0 || x > 1)
			return 0;
		for (int i = 0; i < cumProbs.length; i++) {
			if (cumProbs[i] > x)
				return (double) i / 1000;
		}
		return 1;
	}
	
	public static void main(String[] args) {
		RelativeBetDistribution r = new RelativeBetDistribution();		
		System.out.println(r.cdf(r.inverseCdf(0.83343213)));
		System.out.println(r.inverseCdf(r.cdf(0.83343213)));
	}
}
